<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>现金卡编号列表</title>
</head>
<body>

<div class="container">

    <div class="comm_crub">
        <span class="now_crub">现金卡编号列表</span>
        <button type="button" class="btn btn-primary" style="float: right;margin:4px 15px 0px 0px;" onclick="history.go(-1)">返回上一级</button>
    </div>

    <div class="comm_content">
            <div  class="search-box">
                <form id="searchForm" class="form-inline" onsubmit="return false;">
                    <div style="position:relative">

                        <span>
                            现金卡卡号：
                            <input id="card_no" class="form-control input-sm" type="text" name="card_no" value="" style="width:140px">
                        </span>

                          <span>
                               现金卡状态:
                              <select class="form-control w150" id="card_status" name="card_status">
                                  <option value="">请选择</option>
                                  <option value="1" >已生产</option>
                                  <option value="2" >入库申请</option>
                                  <option value="3" >已入库</option>
                                  <option value="4" >申领申请</option>
                                  <option value="5" >已发卡</option>
                                  <option value="6" >已使用</option>
                                  <option value="7" >作废</option>
                              </select>
                          </span>

                         <span>
                             有效日期：
                             <input type="text" class="form-control w150" id="startDate" name="startDate" readonly="readonly">
                             <label>～</label>
                             <input type="text" class="form-control w150" id="endDate" name="endDate" readonly="readonly">
                         </span>

                        <span>
                            <input type="button" class="btn btn-primary" value="查询" onclick="company.search();">
                        </span>
                        <span>
                            <input type="button" value="重置" id="clearBtn" class="btn btn-warning" onclick="company.clearUp();" />
                        </span>

                    </div>
                </form>
            </div>

            <table id="flex" style="display:none"></table>

        </div>


</div>

<script type="text/javascript">
    $("#flex").flexigrid({
        url:"/invokingAjax-backend/company/card.ajax?operFlg=8&card_id=<!--{$card_id}-->",
        dataType: "json",
        colModel : [
        {display: "现金卡卡号", name : "card_no", sortable : true, width : 150, align : 'center' },
        {display: "现金卡类型", width : 120, align: 'center'},
        {display: "现金卡面值", width : 150, align: 'center'},
        {display: "现金卡状态", width : 150, align: 'center'},
        {display: "可以使用次数", width : 80, align : 'center'},
        {display: "已使用次数", width : 80, align : 'center'},
        {display: "使用的订单号", width : 150, align : 'center'},
        {display: "有效期开始日期", width : 120, align : 'center'},
        {display: "有效期结束日期", width : 120, align : 'center'}
    ],
        sortname: "createTime , card_no",
        sortorder: "asc",
        usepager: true,
        rp: 10,
        useRp: true,
        showTableToggleBtn: true,
        onSubmit: function() {
           var dt = $('#searchForm').serializeArray();
           $("#flex").flexOptions({params: dt});
           return true;
       }
    });

    //日期控件JS
    $('#startDate').datepicker();
    $('#endDate').datepicker();

    var company = {

        //查询
        search: function() {
            var dt = $("#searchForm").serializeArray();
            $("#flex").flexOptions({params: dt}).flexReload();

        },

        //重置
        clearUp:function() {
            $("#card_no").val('');
            $("#card_status").val('');
            $("#startDate").val('');
            $("#endDate").val('');
            this.search();
        }

    };


</script>

</body>
</html>